/*
 * @Author: 自迩
 * @Date: 2022-02-09 01:35:14
 * @LastEditTime: 2022-02-09 17:02:27
 * @LastEditors: your name
 * @Description:
 * @FilePath: \silence-reader\src\components\NoteReadBox\index.jsx
 */
import React, { Component } from 'react';
import './index.css';

export default class NoteReadBox extends Component {

    handleMouseDown = (e)=>{
        e.stopPropagation()
    }

    render() {
        let {noteReadBoxFlag,noteReadBoxText,deleteNote,selectedText} = this.props
        //   let noteText = '加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！加油啊，自迩！！！'
        let noteText = localStorage.getItem(noteReadBoxText)
        return (
            <div className='noteReadBox' style={{display:noteReadBoxFlag? 'block':'none'}} onMouseDown={this.handleMouseDown}>
                <p className='title'>您在此处留下的感想</p>
                <p className='noteText'>{noteText}</p>
                <button className='delNote' onClick={deleteNote(selectedText)}>删除</button>
            </div>
        );
    }
}
